/*
 * @Author: 张旭东 zxd12345688@qq.com
 * @Date: 2025-06-27 08:55:32
 * @LastEditors: 张旭东 zxd12345688@qq.com
 * @LastEditTime: 2025-06-27 09:58:48
 * @FilePath: \23见习2\HelloSwing.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
public class HelloSwing {
    //main方法 应用的主入口
        //System.out.println("Hello,Swing");
        public static void createGui() {
            JFrame frame=new JFrame("HelloSwing");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(500,500);
            frame.setLocationRelativeTo(null);
            //使窗口可见 必须放到代码的最后
            JLabel label = new JLabel("Hello,word",SwingConstants.CENTER);
            frame.getContentPane().add(label);
            frame.setVisible(true);
        }
            //System.out.println("createGui");
            //new JFrame();
            public static void main(String[] args) {
            createGui();
        }
    }